<?php

namespace app\index\controller;

use think\exception\ValidateException;
use app\model\GoodsCourse;

class GoodscourseController extends Base
{
    public function detail()
    {
        $id = input('get.id', '', 'intval');
        if (!empty($id)) {
            $where['id'] = $id;
            $data = GoodsCourse::where($where)->find()?->toArray();
            if (!empty($data)) {
                $data['content'] = \app\model\DomainReplace::setreplace($data['content']);
                $data['create_time'] =  time_ymd($data['create_time']);    
            }
        }
        return $this->json(['data' => $data]);
    }
}
